# 自定义路由转换器


class MobileConverter:
    regex = '1[3-9]\d{9}'

    def to_python(self, value):
        return int(value)

    def to_url(self, value):
        return str(value)


class EmailConverter:
    regex = '[a-zA-Z0-9]{4,64}@(qq|126|163)\.(com|cn)'

    def to_python(self, value):
        return value

    def to_url(self, value):
        return str(value)
